<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 封装函数表达式的函数不管用户输入什么数字，
      // 求出,数组返回 最大值，最小值，平均值，解构出来打印在页面中

    function getSum() {
        let arr1 = [123, 234, 3, 432, 764]

        console.log(Math.max(...arr1))
        // const[a,b,]=[Math.max(...arr1),Math.min(...arr1)]
        // console.log(a);
        console.log(Math.min(...arr1))
       
        let he = 0
        for (let i = 0; i < arr1.length; i++) {
          he += arr1[i]
        }
        // console.log(he / arr1.length)
        const avg = (he / arr1.length)
       console.log(avg)
      }          
    getSum()
    
    </script>
  </body>
</html>
